package is.ru.honn.rumblr.factory;

import is.ru.honn.rumblr.domain.LinkPost;
import is.ru.honn.rumblr.domain.RumblrPost;
import is.ru.honn.rumblr.util.XmlUtil;
import org.dom4j.Element;

public class LinkPostFactory extends PostFactory
{
  @Override
  public RumblrPost createPostFromXML(Element e)
  {
    LinkPost post = new LinkPost();
    createHeader(post, e);
    post.setUrl(XmlUtil.getXPathValue(e, "link-url"));
		post.setText(XmlUtil.getXPathValue(e, "link-text"));
    return post;
  }
}
